<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: Origami::Adobe::PPKLite</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">Origami::Adobe::PPKLite</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../files/origami/parsers/ppklite_rb.html">
                origami/parsers/ppklite.rb
                </a>
        <br />
                <a href="../../../files/origami/adobe/ppklite_rb.html">
                origami/adobe/ppklite.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                Object
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
Class representing an <a href="../Adobe.html">Adobe</a> Reader certificate
store.
</p>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000297">&lt;&lt;</a>&nbsp;&nbsp;
      <a href="#M000298">Catalog</a>&nbsp;&nbsp;
      <a href="#M000307">add_certificate</a>&nbsp;&nbsp;
      <a href="#M000296">append_subobj</a>&nbsp;&nbsp;
      <a href="#M000304">get_cert</a>&nbsp;&nbsp;
      <a href="#M000295">objects</a>&nbsp;&nbsp;
      <a href="#M000299">save</a>&nbsp;&nbsp;
      <a href="#M000300">saveas</a>&nbsp;&nbsp;
      <a href="#M000303">show_cert</a>&nbsp;&nbsp;
      <a href="#M000302">show_certs</a>&nbsp;&nbsp;
      <a href="#M000306">show_entries</a>&nbsp;&nbsp;
      <a href="#M000305">show_user</a>&nbsp;&nbsp;
      <a href="#M000301">show_users</a>&nbsp;&nbsp;
      <a href="#M000308">to_s</a>&nbsp;&nbsp;
      <a href="#M000309">to_str</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">

    <div id="class-list">
      <h3 class="section-bar">Classes and Modules</h3>

      Module <a href="PPKLite/Descriptor.html" class="link">Origami::Adobe::PPKLite::Descriptor</a><br />
Class <a href="PPKLite/AddressList.html" class="link">Origami::Adobe::PPKLite::AddressList</a><br />
Class <a href="PPKLite/Catalog.html" class="link">Origami::Adobe::PPKLite::Catalog</a><br />
Class <a href="PPKLite/Certificate.html" class="link">Origami::Adobe::PPKLite::Certificate</a><br />
Class <a href="PPKLite/Header.html" class="link">Origami::Adobe::PPKLite::Header</a><br />
Class <a href="PPKLite/PPK.html" class="link">Origami::Adobe::PPKLite::PPK</a><br />
Class <a href="PPKLite/Parser.html" class="link">Origami::Adobe::PPKLite::Parser</a><br />
Class <a href="PPKLite/Revision.html" class="link">Origami::Adobe::PPKLite::Revision</a><br />
Class <a href="PPKLite/User.html" class="link">Origami::Adobe::PPKLite::User</a><br />
Class <a href="PPKLite/UserList.html" class="link">Origami::Adobe::PPKLite::UserList</a><br />

    </div>

    <div id="constants-list">
      <h3 class="section-bar">Constants</h3>

      <div class="name-list">
        <table summary="Constants">
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">Size</td>
          <td>=</td>
          <td class="context-item-value">rev.body.size + 1</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">Cert</td>
          <td>=</td>
          <td class="context-item-value">OpenSSL::X509::Certificate.new(certfile).to_der</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">ID</td>
          <td>=</td>
          <td class="context-item-value">self.Catalog.PPK.AddressBook.NextID</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">Trust</td>
          <td>=</td>
          <td class="context-item-value">attributes</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">Viewable</td>
          <td>=</td>
          <td class="context-item-value">viewable</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">Editable</td>
          <td>=</td>
          <td class="context-item-value">editable</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">Size</td>
          <td>=</td>
          <td class="context-item-value">@revisions.first.body.size + 1</td>
        </tr>
        </table>
      </div>
    </div>



    <div id="attribute-list">
      <h3 class="section-bar">Attributes</h3>

      <div class="name-list">
        <table>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">header</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">revisions</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        </table>
      </div>
    </div>
      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000297" class="method-detail">
        <a name="M000297"></a>

        <div class="method-heading">
          <a href="#M000297" class="method-signature">
          <span class="method-name">&lt;&lt;</span><span class="method-args">(object)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000297-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000297-source">
<pre>
     <span class="ruby-comment cmt"># File origami/adobe/ppklite.rb, line 140</span>
140:       <span class="ruby-keyword kw">def</span> <span class="ruby-operator">&lt;&lt;</span>(<span class="ruby-identifier">object</span>)
141:         
142:         <span class="ruby-identifier">object</span>.<span class="ruby-identifier">set_indirect</span>(<span class="ruby-keyword kw">true</span>)
143:         
144:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">object</span>.<span class="ruby-identifier">no</span>.<span class="ruby-identifier">zero?</span>
145:         <span class="ruby-identifier">maxno</span> = <span class="ruby-value">1</span>
146:           <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">get_object</span>(<span class="ruby-identifier">maxno</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-identifier">maxno</span> = <span class="ruby-identifier">maxno</span>.<span class="ruby-identifier">succ</span> <span class="ruby-keyword kw">end</span>
147:           
148:           <span class="ruby-identifier">object</span>.<span class="ruby-identifier">generation</span> = <span class="ruby-value">0</span>
149:           <span class="ruby-identifier">object</span>.<span class="ruby-identifier">no</span> = <span class="ruby-identifier">maxno</span>
150:         <span class="ruby-keyword kw">end</span>
151:         
152:         <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>[<span class="ruby-identifier">object</span>.<span class="ruby-identifier">reference</span>] = <span class="ruby-identifier">object</span>
153:         
154:         <span class="ruby-identifier">object</span>.<span class="ruby-identifier">reference</span>
155:       <span class="ruby-keyword kw">end</span>
156:       
157:       <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Catalog</span>
158:         <span class="ruby-identifier">get_object</span>(<span class="ruby-ivar">@trailer</span>.<span class="ruby-constant">Root</span>)
159:       <span class="ruby-keyword kw">end</span>
160:       
161:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">save</span>(<span class="ruby-identifier">filename</span>)
162:         
163:         <span class="ruby-identifier">bin</span> = <span class="ruby-value str">&quot;&quot;</span>
164:         <span class="ruby-identifier">bin</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@header</span>.<span class="ruby-identifier">to_s</span>
165: 
166:         <span class="ruby-identifier">lastno</span>, <span class="ruby-identifier">brange</span> = <span class="ruby-value">0</span>, <span class="ruby-value">0</span>
167:           
168:         <span class="ruby-identifier">xrefs</span> = [ <span class="ruby-constant">XRef</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>, <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">LASTFREE</span>, <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">FREE</span>) ]
169:         <span class="ruby-identifier">xrefsection</span> = <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">Section</span>.<span class="ruby-identifier">new</span>
170:  
171:         <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span>
172:           <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">obj</span>.<span class="ruby-identifier">no</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">lastno</span>).<span class="ruby-identifier">abs</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>
173:             <span class="ruby-identifier">xrefsection</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">Subsection</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">brange</span>, <span class="ruby-identifier">xrefs</span>)
174:             <span class="ruby-identifier">brange</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">no</span>
175:             <span class="ruby-identifier">xrefs</span>.<span class="ruby-identifier">clear</span>
176:           <span class="ruby-keyword kw">end</span>
177:           
178:           <span class="ruby-identifier">xrefs</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">XRef</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">bin</span>.<span class="ruby-identifier">size</span>, <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">generation</span>, <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">USED</span>)
179:           <span class="ruby-identifier">lastno</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">no</span>
180: 
181:           <span class="ruby-identifier">bin</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">to_s</span>
182:         }
183:         
184:         <span class="ruby-identifier">xrefsection</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">Subsection</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">brange</span>, <span class="ruby-identifier">xrefs</span>)
185:         
186:         <span class="ruby-ivar">@xreftable</span> = <span class="ruby-identifier">xrefsection</span>
187:         <span class="ruby-ivar">@trailer</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Trailer</span>.<span class="ruby-identifier">new</span>
188:         <span class="ruby-ivar">@trailer</span>.<span class="ruby-constant">Size</span> = <span class="ruby-identifier">rev</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
189:         <span class="ruby-ivar">@trailer</span>.<span class="ruby-identifier">startxref</span> = <span class="ruby-identifier">bin</span>.<span class="ruby-identifier">size</span>
190: 
191:         <span class="ruby-identifier">bin</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@xreftable</span>.<span class="ruby-identifier">to_s</span>
192:         <span class="ruby-identifier">bin</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@trailer</span>.<span class="ruby-identifier">to_s</span>
193: 
194:         <span class="ruby-identifier">fd</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-value str">&quot;w&quot;</span>).<span class="ruby-identifier">binmode</span>
195:           <span class="ruby-identifier">fd</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">bin</span> 
196:         <span class="ruby-identifier">fd</span>.<span class="ruby-identifier">close</span>
197:         
198:         <span class="ruby-identifier">show_entries</span>
199:       <span class="ruby-keyword kw">end</span>
200:       <span class="ruby-keyword kw">alias</span> <span class="ruby-identifier">saveas</span> <span class="ruby-identifier">save</span>
201:       
202:       <span class="ruby-comment cmt">#</span>
203:       <span class="ruby-comment cmt"># Prints registered users in the address book</span>
204:       <span class="ruby-comment cmt">#</span>
205:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show_users</span>
206:         
207:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;----------&quot;</span>
208:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Users list&quot;</span>
209:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;----------&quot;</span>
210:         
211:         <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">User</span>) <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">show</span>; <span class="ruby-identifier">puts</span> <span class="ruby-keyword kw">end</span> }
212:         
213:         <span class="ruby-keyword kw">nil</span>
214:       <span class="ruby-keyword kw">end</span>
215:       
216:       <span class="ruby-comment cmt">#</span>
217:       <span class="ruby-comment cmt"># Prints registered certificates in the addressbook</span>
218:       <span class="ruby-comment cmt">#</span>
219:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show_certs</span>
220:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;-----------------&quot;</span>
221:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Certificates list&quot;</span>
222:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;-----------------&quot;</span>
223:         
224:         <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Certificate</span>) <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">show</span>; <span class="ruby-identifier">puts</span> <span class="ruby-keyword kw">end</span> }
225:         
226:         <span class="ruby-keyword kw">nil</span>
227:       <span class="ruby-keyword kw">end</span>
228:       
229:       <span class="ruby-comment cmt">#</span>
230:       <span class="ruby-comment cmt"># Prints certificate with the specified id</span>
231:       <span class="ruby-comment cmt">#</span>
232:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show_cert</span>(<span class="ruby-identifier">id</span>)
233:         <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">find_all</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Certificate</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">obj</span>.<span class="ruby-constant">ID</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">id</span> }.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">cert</span><span class="ruby-operator">|</span>
234:           <span class="ruby-identifier">cert</span>.<span class="ruby-identifier">show</span>
235:           <span class="ruby-identifier">puts</span>
236:         <span class="ruby-keyword kw">end</span>
237:         
238:         <span class="ruby-keyword kw">nil</span>
239:       <span class="ruby-keyword kw">end</span>
240:       
241:       <span class="ruby-comment cmt">#</span>
242:       <span class="ruby-comment cmt"># Returns a Certificate dictionary corresponding to the specified id</span>
243:       <span class="ruby-comment cmt">#</span>
244:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_cert</span>(<span class="ruby-identifier">id</span>)
245:         <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">find</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Certificate</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">obj</span>.<span class="ruby-constant">ID</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">id</span> }
246:       <span class="ruby-keyword kw">end</span>
247:       
248:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show_user</span>(<span class="ruby-identifier">id</span>)
249:         <span class="ruby-identifier">users</span> = <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">find_all</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">User</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">obj</span>.<span class="ruby-constant">ID</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">id</span> }.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">user</span><span class="ruby-operator">|</span>
250:           <span class="ruby-identifier">user</span>.<span class="ruby-identifier">show</span>
251:           <span class="ruby-identifier">puts</span>
252:         <span class="ruby-keyword kw">end</span>
253:         
254:         <span class="ruby-keyword kw">nil</span>
255:       <span class="ruby-keyword kw">end</span>
256:       
257:       <span class="ruby-comment cmt">#</span>
258:       <span class="ruby-comment cmt"># Prints users and certificates registered in the address book</span>
259:       <span class="ruby-comment cmt">#</span>
260:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show_entries</span>
261:         <span class="ruby-identifier">show_users</span>
262:         <span class="ruby-identifier">show_certs</span>
263:         
264:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;End of address book.&quot;</span>
265:       <span class="ruby-keyword kw">end</span>
266:       
267:       <span class="ruby-comment cmt">#</span>
268:       <span class="ruby-comment cmt"># Add a certificate into the address book</span>
269:       <span class="ruby-comment cmt">#</span>
270:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_certificate</span>(<span class="ruby-identifier">certfile</span>, <span class="ruby-identifier">attributes</span>, <span class="ruby-identifier">viewable</span> = <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">editable</span> = <span class="ruby-keyword kw">false</span>)
271:         
272:         <span class="ruby-identifier">cert</span> = <span class="ruby-constant">Certificate</span>.<span class="ruby-identifier">new</span>
273:         <span class="ruby-identifier">cert</span>.<span class="ruby-constant">Cert</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">X509</span><span class="ruby-operator">::</span><span class="ruby-constant">Certificate</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">certfile</span>).<span class="ruby-identifier">to_der</span>
274:         <span class="ruby-identifier">cert</span>.<span class="ruby-constant">ID</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-constant">Catalog</span>.<span class="ruby-constant">PPK</span>.<span class="ruby-constant">AddressBook</span>.<span class="ruby-constant">NextID</span>
275:         <span class="ruby-keyword kw">self</span>.<span class="ruby-constant">Catalog</span>.<span class="ruby-constant">PPK</span>.<span class="ruby-constant">AddressBook</span>.<span class="ruby-constant">NextID</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
276:         <span class="ruby-identifier">cert</span>.<span class="ruby-constant">Trust</span> = <span class="ruby-identifier">attributes</span>
277:         <span class="ruby-identifier">cert</span>.<span class="ruby-constant">Viewable</span> = <span class="ruby-identifier">viewable</span>
278:         <span class="ruby-identifier">cert</span>.<span class="ruby-constant">Editable</span> = <span class="ruby-identifier">editable</span>
279:         
280:         <span class="ruby-keyword kw">self</span>.<span class="ruby-constant">Catalog</span>.<span class="ruby-constant">PPK</span>.<span class="ruby-constant">AddressBook</span>.<span class="ruby-constant">Entries</span>.<span class="ruby-identifier">push</span>(<span class="ruby-keyword kw">self</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">cert</span>)
281:         
282:         <span class="ruby-identifier">show_certs</span>
283:       <span class="ruby-keyword kw">end</span>
284:       
285:       <span class="ruby-keyword kw">alias</span> <span class="ruby-identifier">to_s</span> <span class="ruby-identifier">show_entries</span>
286:       <span class="ruby-keyword kw">alias</span> <span class="ruby-identifier">to_str</span> <span class="ruby-identifier">show_entries</span>
287:       
288:       <span class="ruby-keyword kw">class</span> <span class="ruby-constant">Catalog</span> <span class="ruby-operator">&lt;</span> <span class="ruby-constant">Dictionary</span>
289:         
290:         <span class="ruby-identifier">include</span> <span class="ruby-constant">StandardObject</span>
291: 
292:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:Type</span>,      <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Name</span>, <span class="ruby-identifier">:Default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:Catalog</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
293:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:PPK</span>,       <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Dictionary</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
294:         
295:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">hash</span> = {}) <span class="ruby-comment cmt">#:nodoc:</span>
296:           <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">hash</span>)
297:         <span class="ruby-keyword kw">end</span>
298:         
299:       <span class="ruby-keyword kw">end</span>
300:       
301:       <span class="ruby-keyword kw">class</span> <span class="ruby-constant">PPK</span> <span class="ruby-operator">&lt;</span> <span class="ruby-constant">Dictionary</span>
302:         
303:         <span class="ruby-identifier">include</span> <span class="ruby-constant">StandardObject</span>
304: 
305:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:Type</span>,        <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Name</span>, <span class="ruby-identifier">:Default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:PPK</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
306:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:User</span>,        <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Dictionary</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
307:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:AddressBook</span>, <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Dictionary</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
308:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:V</span>,           <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Integer</span>, <span class="ruby-identifier">:Default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">0x10001</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
309:         
310:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">hash</span> = {}) <span class="ruby-comment cmt">#:nodoc:</span>
311:           <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">hash</span>)
312:         <span class="ruby-keyword kw">end</span>
313:         
314:       <span class="ruby-keyword kw">end</span>
315:       
316:       <span class="ruby-keyword kw">class</span> <span class="ruby-constant">UserList</span> <span class="ruby-operator">&lt;</span> <span class="ruby-constant">Dictionary</span>
317:         
318:         <span class="ruby-identifier">include</span> <span class="ruby-constant">StandardObject</span>
319: 
320:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:Type</span>,        <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Name</span>, <span class="ruby-identifier">:Default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:User</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
321:         
322:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">hash</span> = {})
323:           <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">hash</span>)
324:         <span class="ruby-keyword kw">end</span>
325:         
326:       <span class="ruby-keyword kw">end</span>
327:       
328:       <span class="ruby-keyword kw">class</span> <span class="ruby-constant">AddressList</span> <span class="ruby-operator">&lt;</span> <span class="ruby-constant">Dictionary</span>
329:         
330:         <span class="ruby-identifier">include</span> <span class="ruby-constant">StandardObject</span>
331: 
332:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:Type</span>,        <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Name</span>, <span class="ruby-identifier">:Default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:AddressBook</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
333:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:NextID</span>,      <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Integer</span>
334:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:Entries</span>,     <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Array</span>, <span class="ruby-identifier">:Default</span> =<span class="ruby-operator">&gt;</span> [], <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
335:         
336:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">hash</span> = {}) <span class="ruby-comment cmt">#:nodoc:</span>
337:           <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">hash</span>)
338:         <span class="ruby-keyword kw">end</span>
339:         
340:       <span class="ruby-keyword kw">end</span>
341:       
342:       <span class="ruby-keyword kw">module</span> <span class="ruby-constant">Descriptor</span>
343:         
344:         <span class="ruby-constant">CERTIFICATE</span> = <span class="ruby-value">1</span>
345:         <span class="ruby-constant">USER</span> = <span class="ruby-value">2</span>
346: 
347:         <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">included</span>(<span class="ruby-identifier">receiver</span>) <span class="ruby-comment cmt">#:nodoc:</span>
348:           <span class="ruby-identifier">receiver</span>.<span class="ruby-identifier">field</span>    <span class="ruby-identifier">:ID</span>,        <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Integer</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
349:           <span class="ruby-identifier">receiver</span>.<span class="ruby-identifier">field</span>    <span class="ruby-identifier">:ABEType</span>,   <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Integer</span>, <span class="ruby-identifier">:Default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Descriptor</span><span class="ruby-operator">::</span><span class="ruby-constant">CERTIFICATE</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
350:         <span class="ruby-keyword kw">end</span>
351:         
352:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">hash</span> = {}) <span class="ruby-comment cmt">#:nodoc:</span>
353:           <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">hash</span>)
354:         <span class="ruby-keyword kw">end</span>
355:         
356:       <span class="ruby-keyword kw">end</span>
357:       
358:       <span class="ruby-keyword kw">class</span> <span class="ruby-constant">User</span> <span class="ruby-operator">&lt;</span> <span class="ruby-constant">Dictionary</span>
359:         
360:         <span class="ruby-identifier">include</span> <span class="ruby-constant">StandardObject</span>
361:         <span class="ruby-identifier">include</span> <span class="ruby-constant">Descriptor</span>
362: 
363:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:ABEType</span>,       <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Integer</span>, <span class="ruby-identifier">:Default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Descriptor</span><span class="ruby-operator">::</span><span class="ruby-constant">USER</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
364:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:Name</span>,          <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">String</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
365:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:Encrypt</span>,       <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Integer</span>
366:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:Certs</span>,         <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Array</span>, <span class="ruby-identifier">:Default</span> =<span class="ruby-operator">&gt;</span> [], <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
367:         
368:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show</span>
369:           <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;ID: #{self.ID}&quot;</span>
370:           <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Name: #{self.Name}&quot;</span>
371:           <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Certificates: &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-constant">Certs</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;, &quot;</span>)
372:         <span class="ruby-keyword kw">end</span>
373:         
374:       <span class="ruby-keyword kw">end</span>
375:       
376:       <span class="ruby-keyword kw">class</span> <span class="ruby-constant">Certificate</span> <span class="ruby-operator">&lt;</span> <span class="ruby-constant">Dictionary</span>
377:         
378:         <span class="ruby-identifier">include</span> <span class="ruby-constant">StandardObject</span>
379:         <span class="ruby-identifier">include</span> <span class="ruby-constant">Descriptor</span>
380:         
381:         <span class="ruby-keyword kw">module</span> <span class="ruby-constant">Flags</span>
382:           
383:           <span class="ruby-constant">CAN_CERTIFY</span> = <span class="ruby-value">1</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value">1</span>
384:           <span class="ruby-constant">ALLOW_DYNAMIC_CONTENT</span> = <span class="ruby-value">1</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value">2</span>
385:           <span class="ruby-constant">UNKNOWN_1</span> = <span class="ruby-value">1</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value">3</span>
386:           <span class="ruby-constant">ALLOW_HIGH_PRIV_JS</span> = <span class="ruby-value">1</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value">4</span>
387:           <span class="ruby-constant">UNKNOWN_2</span> = <span class="ruby-value">1</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value">5</span>
388:           <span class="ruby-constant">IS_ROOT_CA</span> = <span class="ruby-value">1</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value">6</span>
389:           
390:           <span class="ruby-comment cmt">#~ FULL_TRUST = 1 &lt;&lt; 1 | 1 &lt;&lt; 2 | 1 &lt;&lt; 3 | 1 &lt;&lt; 4 | 1 &lt;&lt; 5 | 1 &lt;&lt; 6</span>
391:           <span class="ruby-constant">FULL_TRUST</span> = <span class="ruby-value">8190</span>
392:         <span class="ruby-keyword kw">end</span>
393: 
394:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:ABEType</span>,       <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Integer</span>, <span class="ruby-identifier">:Default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Descriptor</span><span class="ruby-operator">::</span><span class="ruby-constant">CERTIFICATE</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
395:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:Usage</span>,         <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Integer</span>, <span class="ruby-identifier">:Default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
396:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:Viewable</span>,      <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Boolean</span>, <span class="ruby-identifier">:Default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
397:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:Editable</span>,      <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Boolean</span>, <span class="ruby-identifier">:Default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
398:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:Cert</span>,          <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">String</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
399:         <span class="ruby-identifier">field</span>   <span class="ruby-identifier">:Trust</span>,         <span class="ruby-identifier">:Type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Integer</span>, <span class="ruby-identifier">:Default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Flags</span><span class="ruby-operator">::</span><span class="ruby-constant">UNKNOWN_2</span>, <span class="ruby-identifier">:Required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>
400:         
401:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show</span>
402:           <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;ID: #{self.ID}&quot;</span>
403:           <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Viewable: #{self.Viewable}&quot;</span>
404:           <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Editable: #{self.Editable}&quot;</span>
405:           <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Trust attributes: #{self.Trust}&quot;</span>
406:         <span class="ruby-keyword kw">end</span>
407:         
408:       <span class="ruby-keyword kw">end</span>
409:        
410:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_object</span>(<span class="ruby-identifier">no</span>, <span class="ruby-identifier">generation</span> = <span class="ruby-value">0</span>) <span class="ruby-comment cmt">#:nodoc:</span>
411:          
412:         <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">no</span>
413:         <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Reference</span>
414:           <span class="ruby-identifier">target</span> = <span class="ruby-identifier">no</span>
415:         <span class="ruby-keyword kw">when</span> <span class="ruby-operator">::</span><span class="ruby-constant">Integer</span>
416:           <span class="ruby-identifier">target</span> = <span class="ruby-constant">Reference</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">no</span>, <span class="ruby-identifier">generation</span>)
417:         <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Origami</span><span class="ruby-operator">::</span><span class="ruby-constant">Object</span>
418:           <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">no</span>
419:         <span class="ruby-keyword kw">end</span>
420:        
421:         <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>[<span class="ruby-identifier">target</span>]
422:       <span class="ruby-keyword kw">end</span>
423:       
424:       <span class="ruby-identifier">private</span>
425:       
426:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rebuildxrefs</span> <span class="ruby-comment cmt">#:nodoc:</span>
427:         
428:         <span class="ruby-identifier">startxref</span> = <span class="ruby-ivar">@header</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">size</span>
429:         
430:         <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">object</span><span class="ruby-operator">|</span>
431:           <span class="ruby-identifier">startxref</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">object</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">size</span>
432:         }
433:           
434:         <span class="ruby-ivar">@xreftable</span> = <span class="ruby-identifier">buildxrefs</span>(<span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>)
435:         
436:         <span class="ruby-ivar">@trailer</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Trailer</span>.<span class="ruby-identifier">new</span>
437:         <span class="ruby-ivar">@trailer</span>.<span class="ruby-constant">Size</span> = <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
438:         <span class="ruby-ivar">@trailer</span>.<span class="ruby-identifier">startxref</span> = <span class="ruby-identifier">startxref</span>
439:         
440:         <span class="ruby-keyword kw">self</span>
441:       <span class="ruby-keyword kw">end</span>
442:       
443:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">buildxrefs</span>(<span class="ruby-identifier">objects</span>) <span class="ruby-comment cmt">#:nodoc:</span>
444:         
445:         <span class="ruby-identifier">lastno</span> = <span class="ruby-value">0</span>
446:         <span class="ruby-identifier">brange</span> = <span class="ruby-value">0</span>
447:         
448:         <span class="ruby-identifier">xrefs</span> = [ <span class="ruby-constant">XRef</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>, <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">LASTFREE</span>, <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">FREE</span>) ]
449:         
450:         <span class="ruby-identifier">xrefsection</span> = <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">Section</span>.<span class="ruby-identifier">new</span>
451:         <span class="ruby-identifier">objects</span>.<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">object</span><span class="ruby-operator">|</span>
452:           <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">object</span>.<span class="ruby-identifier">no</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">lastno</span>).<span class="ruby-identifier">abs</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>
453:             <span class="ruby-identifier">xrefsection</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">Subsection</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">brange</span>, <span class="ruby-identifier">xrefs</span>)
454:             <span class="ruby-identifier">brange</span> = <span class="ruby-identifier">object</span>.<span class="ruby-identifier">no</span>
455:             <span class="ruby-identifier">xrefs</span>.<span class="ruby-identifier">clear</span>
456:           <span class="ruby-keyword kw">end</span>
457:           
458:           <span class="ruby-identifier">xrefs</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">XRef</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">get_object_offset</span>(<span class="ruby-identifier">object</span>.<span class="ruby-identifier">no</span>, <span class="ruby-identifier">object</span>.<span class="ruby-identifier">generation</span>), <span class="ruby-identifier">object</span>.<span class="ruby-identifier">generation</span>, <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">USED</span>)
459: 
460:           <span class="ruby-identifier">lastno</span> = <span class="ruby-identifier">object</span>.<span class="ruby-identifier">no</span>
461:         }
462:         
463:         <span class="ruby-identifier">xrefsection</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">Subsection</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">brange</span>, <span class="ruby-identifier">xrefs</span>)
464:         
465:         <span class="ruby-identifier">xrefsection</span>
466:       <span class="ruby-keyword kw">end</span>
467:      
468:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_object_offset</span>(<span class="ruby-identifier">no</span>,<span class="ruby-identifier">generation</span>) <span class="ruby-comment cmt">#:nodoc:</span>
469: 
470:         <span class="ruby-identifier">bodyoffset</span> = <span class="ruby-ivar">@header</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">size</span>
471:         
472:         <span class="ruby-identifier">objectoffset</span> = <span class="ruby-identifier">bodyoffset</span>
473:           
474:         <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">object</span><span class="ruby-operator">|</span>
475:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">object</span>.<span class="ruby-identifier">no</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">no</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">object</span>.<span class="ruby-identifier">generation</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">generation</span> <span class="ruby-keyword kw">then</span> <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">objectoffset</span>
476:           <span class="ruby-keyword kw">else</span>
477:             <span class="ruby-identifier">objectoffset</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">object</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">size</span>
478:           <span class="ruby-keyword kw">end</span>
479:         }
480:         
481:         <span class="ruby-keyword kw">nil</span>
482:       <span class="ruby-keyword kw">end</span>
483:       
484:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000298" class="method-detail">
        <a name="M000298"></a>

        <div class="method-heading">
          <a href="#M000298" class="method-signature">
          <span class="method-name">Catalog</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000298-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000298-source">
<pre>
     <span class="ruby-comment cmt"># File origami/adobe/ppklite.rb, line 157</span>
157:       <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Catalog</span>
158:         <span class="ruby-identifier">get_object</span>(<span class="ruby-ivar">@trailer</span>.<span class="ruby-constant">Root</span>)
159:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000307" class="method-detail">
        <a name="M000307"></a>

        <div class="method-heading">
          <a href="#M000307" class="method-signature">
          <span class="method-name">add_certificate</span><span class="method-args">(certfile, attributes, viewable = false, editable = false)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Add a certificate into the address book
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000307-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000307-source">
<pre>
     <span class="ruby-comment cmt"># File origami/adobe/ppklite.rb, line 270</span>
270:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_certificate</span>(<span class="ruby-identifier">certfile</span>, <span class="ruby-identifier">attributes</span>, <span class="ruby-identifier">viewable</span> = <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">editable</span> = <span class="ruby-keyword kw">false</span>)
271:         
272:         <span class="ruby-identifier">cert</span> = <span class="ruby-constant">Certificate</span>.<span class="ruby-identifier">new</span>
273:         <span class="ruby-identifier">cert</span>.<span class="ruby-constant">Cert</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">X509</span><span class="ruby-operator">::</span><span class="ruby-constant">Certificate</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">certfile</span>).<span class="ruby-identifier">to_der</span>
274:         <span class="ruby-identifier">cert</span>.<span class="ruby-constant">ID</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-constant">Catalog</span>.<span class="ruby-constant">PPK</span>.<span class="ruby-constant">AddressBook</span>.<span class="ruby-constant">NextID</span>
275:         <span class="ruby-keyword kw">self</span>.<span class="ruby-constant">Catalog</span>.<span class="ruby-constant">PPK</span>.<span class="ruby-constant">AddressBook</span>.<span class="ruby-constant">NextID</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
276:         <span class="ruby-identifier">cert</span>.<span class="ruby-constant">Trust</span> = <span class="ruby-identifier">attributes</span>
277:         <span class="ruby-identifier">cert</span>.<span class="ruby-constant">Viewable</span> = <span class="ruby-identifier">viewable</span>
278:         <span class="ruby-identifier">cert</span>.<span class="ruby-constant">Editable</span> = <span class="ruby-identifier">editable</span>
279:         
280:         <span class="ruby-keyword kw">self</span>.<span class="ruby-constant">Catalog</span>.<span class="ruby-constant">PPK</span>.<span class="ruby-constant">AddressBook</span>.<span class="ruby-constant">Entries</span>.<span class="ruby-identifier">push</span>(<span class="ruby-keyword kw">self</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">cert</span>)
281:         
282:         <span class="ruby-identifier">show_certs</span>
283:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000296" class="method-detail">
        <a name="M000296"></a>

        <div class="method-heading">
          <a href="#M000296" class="method-signature">
          <span class="method-name">append_subobj</span><span class="method-args">(root, objset)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000296-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000296-source">
<pre>
     <span class="ruby-comment cmt"># File origami/adobe/ppklite.rb, line 121</span>
121:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">append_subobj</span>(<span class="ruby-identifier">root</span>, <span class="ruby-identifier">objset</span>)
122:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">objset</span>.<span class="ruby-identifier">find</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">o</span><span class="ruby-operator">|</span> <span class="ruby-identifier">o</span>.<span class="ruby-identifier">object_id</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">root</span>.<span class="ruby-identifier">object_id</span> }.<span class="ruby-identifier">nil?</span>
123:             <span class="ruby-identifier">objset</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">root</span>
124:             <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">root</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>) <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">root</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Dictionary</span>)
125:               <span class="ruby-identifier">root</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">subobj</span><span class="ruby-operator">|</span> <span class="ruby-identifier">append_subobj</span>(<span class="ruby-identifier">subobj</span>, <span class="ruby-identifier">objset</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">subobj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Reference</span>) }
126:             <span class="ruby-keyword kw">end</span>
127:           <span class="ruby-keyword kw">end</span>
128:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000304" class="method-detail">
        <a name="M000304"></a>

        <div class="method-heading">
          <a href="#M000304" class="method-signature">
          <span class="method-name">get_cert</span><span class="method-args">(id)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns a <a href="PPKLite/Certificate.html">Certificate</a> dictionary
corresponding to the specified id
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000304-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000304-source">
<pre>
     <span class="ruby-comment cmt"># File origami/adobe/ppklite.rb, line 244</span>
244:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_cert</span>(<span class="ruby-identifier">id</span>)
245:         <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">find</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Certificate</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">obj</span>.<span class="ruby-constant">ID</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">id</span> }
246:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000295" class="method-detail">
        <a name="M000295"></a>

        <div class="method-heading">
          <a href="#M000295" class="method-signature">
          <span class="method-name">objects</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000295-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000295-source">
<pre>
     <span class="ruby-comment cmt"># File origami/adobe/ppklite.rb, line 120</span>
120:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">objects</span>
121:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">append_subobj</span>(<span class="ruby-identifier">root</span>, <span class="ruby-identifier">objset</span>)
122:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">objset</span>.<span class="ruby-identifier">find</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">o</span><span class="ruby-operator">|</span> <span class="ruby-identifier">o</span>.<span class="ruby-identifier">object_id</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">root</span>.<span class="ruby-identifier">object_id</span> }.<span class="ruby-identifier">nil?</span>
123:             <span class="ruby-identifier">objset</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">root</span>
124:             <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">root</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>) <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">root</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Dictionary</span>)
125:               <span class="ruby-identifier">root</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">subobj</span><span class="ruby-operator">|</span> <span class="ruby-identifier">append_subobj</span>(<span class="ruby-identifier">subobj</span>, <span class="ruby-identifier">objset</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">subobj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Reference</span>) }
126:             <span class="ruby-keyword kw">end</span>
127:           <span class="ruby-keyword kw">end</span>
128:         <span class="ruby-keyword kw">end</span>
129:         
130:         <span class="ruby-identifier">objset</span> = []
131:         <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">object</span><span class="ruby-operator">|</span>
132:           <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">object</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Reference</span>)
133:             <span class="ruby-identifier">append_subobj</span>(<span class="ruby-identifier">object</span>, <span class="ruby-identifier">objset</span>)
134:           <span class="ruby-keyword kw">end</span>
135:         <span class="ruby-keyword kw">end</span>
136:         
137:         <span class="ruby-identifier">objset</span>
138:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000299" class="method-detail">
        <a name="M000299"></a>

        <div class="method-heading">
          <a href="#M000299" class="method-signature">
          <span class="method-name">save</span><span class="method-args">(filename)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000299-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000299-source">
<pre>
     <span class="ruby-comment cmt"># File origami/adobe/ppklite.rb, line 161</span>
161:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">save</span>(<span class="ruby-identifier">filename</span>)
162:         
163:         <span class="ruby-identifier">bin</span> = <span class="ruby-value str">&quot;&quot;</span>
164:         <span class="ruby-identifier">bin</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@header</span>.<span class="ruby-identifier">to_s</span>
165: 
166:         <span class="ruby-identifier">lastno</span>, <span class="ruby-identifier">brange</span> = <span class="ruby-value">0</span>, <span class="ruby-value">0</span>
167:           
168:         <span class="ruby-identifier">xrefs</span> = [ <span class="ruby-constant">XRef</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span>, <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">LASTFREE</span>, <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">FREE</span>) ]
169:         <span class="ruby-identifier">xrefsection</span> = <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">Section</span>.<span class="ruby-identifier">new</span>
170:  
171:         <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span>
172:           <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">obj</span>.<span class="ruby-identifier">no</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">lastno</span>).<span class="ruby-identifier">abs</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>
173:             <span class="ruby-identifier">xrefsection</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">Subsection</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">brange</span>, <span class="ruby-identifier">xrefs</span>)
174:             <span class="ruby-identifier">brange</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">no</span>
175:             <span class="ruby-identifier">xrefs</span>.<span class="ruby-identifier">clear</span>
176:           <span class="ruby-keyword kw">end</span>
177:           
178:           <span class="ruby-identifier">xrefs</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">XRef</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">bin</span>.<span class="ruby-identifier">size</span>, <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">generation</span>, <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">USED</span>)
179:           <span class="ruby-identifier">lastno</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">no</span>
180: 
181:           <span class="ruby-identifier">bin</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">to_s</span>
182:         }
183:         
184:         <span class="ruby-identifier">xrefsection</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">XRef</span><span class="ruby-operator">::</span><span class="ruby-constant">Subsection</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">brange</span>, <span class="ruby-identifier">xrefs</span>)
185:         
186:         <span class="ruby-ivar">@xreftable</span> = <span class="ruby-identifier">xrefsection</span>
187:         <span class="ruby-ivar">@trailer</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Trailer</span>.<span class="ruby-identifier">new</span>
188:         <span class="ruby-ivar">@trailer</span>.<span class="ruby-constant">Size</span> = <span class="ruby-identifier">rev</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
189:         <span class="ruby-ivar">@trailer</span>.<span class="ruby-identifier">startxref</span> = <span class="ruby-identifier">bin</span>.<span class="ruby-identifier">size</span>
190: 
191:         <span class="ruby-identifier">bin</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@xreftable</span>.<span class="ruby-identifier">to_s</span>
192:         <span class="ruby-identifier">bin</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@trailer</span>.<span class="ruby-identifier">to_s</span>
193: 
194:         <span class="ruby-identifier">fd</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-value str">&quot;w&quot;</span>).<span class="ruby-identifier">binmode</span>
195:           <span class="ruby-identifier">fd</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">bin</span> 
196:         <span class="ruby-identifier">fd</span>.<span class="ruby-identifier">close</span>
197:         
198:         <span class="ruby-identifier">show_entries</span>
199:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000300" class="method-detail">
        <a name="M000300"></a>

        <div class="method-heading">
          <span class="method-name">saveas</span><span class="method-args">(filename)</span>
        </div>
      
        <div class="method-description">
          <p>
Alias for <a href="PPKLite.html#M000299">save</a>
</p>
        </div>
      </div>

      <div id="method-M000303" class="method-detail">
        <a name="M000303"></a>

        <div class="method-heading">
          <a href="#M000303" class="method-signature">
          <span class="method-name">show_cert</span><span class="method-args">(id)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Prints certificate with the specified id
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000303-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000303-source">
<pre>
     <span class="ruby-comment cmt"># File origami/adobe/ppklite.rb, line 232</span>
232:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show_cert</span>(<span class="ruby-identifier">id</span>)
233:         <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">find_all</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Certificate</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">obj</span>.<span class="ruby-constant">ID</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">id</span> }.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">cert</span><span class="ruby-operator">|</span>
234:           <span class="ruby-identifier">cert</span>.<span class="ruby-identifier">show</span>
235:           <span class="ruby-identifier">puts</span>
236:         <span class="ruby-keyword kw">end</span>
237:         
238:         <span class="ruby-keyword kw">nil</span>
239:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000302" class="method-detail">
        <a name="M000302"></a>

        <div class="method-heading">
          <a href="#M000302" class="method-signature">
          <span class="method-name">show_certs</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Prints registered certificates in the addressbook
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000302-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000302-source">
<pre>
     <span class="ruby-comment cmt"># File origami/adobe/ppklite.rb, line 219</span>
219:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show_certs</span>
220:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;-----------------&quot;</span>
221:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Certificates list&quot;</span>
222:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;-----------------&quot;</span>
223:         
224:         <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Certificate</span>) <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">show</span>; <span class="ruby-identifier">puts</span> <span class="ruby-keyword kw">end</span> }
225:         
226:         <span class="ruby-keyword kw">nil</span>
227:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000306" class="method-detail">
        <a name="M000306"></a>

        <div class="method-heading">
          <a href="#M000306" class="method-signature">
          <span class="method-name">show_entries</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Prints users and certificates registered in the address book
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000306-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000306-source">
<pre>
     <span class="ruby-comment cmt"># File origami/adobe/ppklite.rb, line 260</span>
260:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show_entries</span>
261:         <span class="ruby-identifier">show_users</span>
262:         <span class="ruby-identifier">show_certs</span>
263:         
264:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;End of address book.&quot;</span>
265:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000305" class="method-detail">
        <a name="M000305"></a>

        <div class="method-heading">
          <a href="#M000305" class="method-signature">
          <span class="method-name">show_user</span><span class="method-args">(id)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000305-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000305-source">
<pre>
     <span class="ruby-comment cmt"># File origami/adobe/ppklite.rb, line 248</span>
248:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show_user</span>(<span class="ruby-identifier">id</span>)
249:         <span class="ruby-identifier">users</span> = <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">find_all</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">User</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">obj</span>.<span class="ruby-constant">ID</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">id</span> }.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">user</span><span class="ruby-operator">|</span>
250:           <span class="ruby-identifier">user</span>.<span class="ruby-identifier">show</span>
251:           <span class="ruby-identifier">puts</span>
252:         <span class="ruby-keyword kw">end</span>
253:         
254:         <span class="ruby-keyword kw">nil</span>
255:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000301" class="method-detail">
        <a name="M000301"></a>

        <div class="method-heading">
          <a href="#M000301" class="method-signature">
          <span class="method-name">show_users</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Prints registered users in the address book
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000301-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000301-source">
<pre>
     <span class="ruby-comment cmt"># File origami/adobe/ppklite.rb, line 205</span>
205:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show_users</span>
206:         
207:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;----------&quot;</span>
208:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Users list&quot;</span>
209:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;----------&quot;</span>
210:         
211:         <span class="ruby-ivar">@revisions</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">body</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">User</span>) <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">show</span>; <span class="ruby-identifier">puts</span> <span class="ruby-keyword kw">end</span> }
212:         
213:         <span class="ruby-keyword kw">nil</span>
214:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000308" class="method-detail">
        <a name="M000308"></a>

        <div class="method-heading">
          <span class="method-name">to_s</span><span class="method-args">()</span>
        </div>
      
        <div class="method-description">
          <p>
Alias for <a href="PPKLite.html#M000306">show_entries</a>
</p>
        </div>
      </div>

      <div id="method-M000309" class="method-detail">
        <a name="M000309"></a>

        <div class="method-heading">
          <span class="method-name">to_str</span><span class="method-args">()</span>
        </div>
      
        <div class="method-description">
          <p>
Alias for <a href="PPKLite.html#M000306">show_entries</a>
</p>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>